import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/utils/date_time_utils.dart';

class TaxSubmissionDetailEntity with JsonConvert<TaxSubmissionDetailEntity> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "start_date")
  String startDate;
  @JSONField(name: "end_date")
  String endDate;
  List<TaxSubmissionDetailTaxSubmissionLines> lines;
  String status;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;

  @JSONField(name: "year_of_assessment")
  dynamic yearOfAssessment;
  String type;

  set timeRange(String value) {}

  String get timeRange =>
      '${DateTimeUtils.formatDateTimeString(startDate)} - ${DateTimeUtils.formatDateTimeString(endDate)}';
}

class TaxSubmissionDetailTaxSubmissionLines
    with JsonConvert<TaxSubmissionDetailTaxSubmissionLines> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "tax_submission_id")
  int taxSubmissionId;
  String key;
  int line;
  String name;
  num amount;

  @JSONField(name: "created_at")
  String createdAt;

  @JSONField(name: "updated_at")
  String updatedAt;
}
